package com.bdqn.ch01.web;

import com.bdqn.ch01.comm.DomeInfo;
import com.bdqn.ch01.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class HelloController {
    @Resource
    private DomeInfo domeInfo;
    @Autowired
    private  DemoService demoService;
    @RequestMapping("/hello")
    public String hello(){
        String msg = demoService.sayHello();
        msg += ""+" "+domeInfo.getName()+""+domeInfo.getEmail();
        return msg;
    }
    @Value("${com.bdqn.name}")
    private String name;
    @Value("${com.ktjiaoyu.name}")
    private String email;

}
